﻿namespace FiftyOne.Foundation.Mobile.Detection.Wurfl.Configuration
{
    using System;
    using System.Configuration;

    public sealed class PatchConfigElement : ConfigurationElement
    {
        [ConfigurationProperty("enabled", IsRequired=false, DefaultValue=true)]
        public bool Enabled
        {
            get
            {
                return (bool) base["enabled"];
            }
            set
            {
                base["enabled"] = value;
            }
        }

        [ConfigurationProperty("filePath", DefaultValue="~/bin/wurfl_patch.xml", IsRequired=true), StringValidator(InvalidCharacters="!@#$%^&*()[]{};'\"|", MaxLength=0xff)]
        public string FilePath
        {
            get
            {
                return (string) base["filePath"];
            }
            set
            {
                base["filePath"] = value;
            }
        }

        [StringValidator(InvalidCharacters="!@#$%^&*()[]{};'\"|\\", MinLength=1, MaxLength=60), ConfigurationProperty("name", DefaultValue="wurfl_patch_file", IsRequired=true, IsKey=true)]
        public string Name
        {
            get
            {
                return (string) base["name"];
            }
            set
            {
                base["name"] = value;
            }
        }
    }
}

